<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            box-sizing: border-box;
            width: 400px;
            height: 50px;
            background: darkcyan;
            margin: 0 auto;
            text-align: center;
            line-height: 50px;
            padding-left: 110px;
        }
        div img{
            margin-top: 6px;
            float: left;
        }
        div span{
            float: left;
            height: 50px;
            width: 10px;
            font-size: 20px;
        }
    </style>
</head>
<body>
    <div>
        <img src="img/0.png" alt="">
        <img src="img/0.png" alt="">
        <span> : </span>
        <img src="img/0.png" alt="">
        <img src="img/0.png" alt="">
        <span> : </span>
        <img src="img/0.png" alt="">
        <img src="img/0.png" alt="">
    </div>
    <script>
        var imgs = document.getElementsByTagName('img');
        console.log(imgs)

        setInterval(
            function(){
                var d = new Date();
                var hours = d.getHours();
                var minutes = d.getMinutes();
                var seconds = d.getSeconds();
                var str = addzero(hours)+addzero(minutes)+addzero(seconds);
                console.log(str)
                for(var i=0;i<imgs.length;i++){
                    imgs[i].src = 'img/'+str[i]+'.png'
                }
                console.log(imgs)
            },1000
        )

        function addzero(n){
            return n<10 ? '0'+ n : '' + n
        }
    </script>
</body>
</html>